package com.ld.hpfs.dao;

import java.util.ArrayList;
import java.util.HashMap;

import org.springframework.stereotype.Repository;

/**
 * 发票页面的Dao层
 * 
 * @author
 * 
 */
@Repository
public interface ApplyFormMapper {

	/**
	 * 发票一览取得
	 * @param params
	 * @return
	 */
	public ArrayList<HashMap<String,Object>> getApplyFormList(HashMap<String, Object> params);

	/**
	 * 发票表单删除
	 * 
	 * @return
	 */
	public int deleteApplyFormList(HashMap<String, Object> params);

	/**
	 * 指定FormId发票删除
	 * 
	 * @return
	 */
	public int deleteApplyFormInvoiceByFormId(HashMap<String, Object> params);

	/**
	 * 指定FormId营业税发票删除
	 * 
	 * @return
	 */
	public int deleteApplyFormInvoiceTaxByFormId(HashMap<String, Object> params);
	
	/**
	 * 指定FormId申请发票附件删除
	 * 
	 * @return
	 */
	public int deleteApplyFormAttacheFileByFormId(HashMap<String, Object> params);
	
	
	/**
	 * 发票中的下拉框信息取得
	 * 
	 * @return
	 */
	public ArrayList<HashMap<String, Object>> getTaxCommonData();

	/**
	 * 申请发票取得
	 * @param params(formId)
	 * @return
	 */
	public HashMap<String, Object> getApplyForm(HashMap<String, Object> params);

	/**
	 * 申请发票上传附件取得
	 * 
	 * @param params(formId)
	 * @return
	 */
	public ArrayList<HashMap<String,Object>> getApplyFormAttacheFileList(HashMap<String, Object> params);

	/**
	 * 申请发票上传附件插入
	 * 
	 * @param params(formId, attcheFileId 自增长)
	 * @return 影响件数。返回附件Id:params["attacheFileId"]
	 */
	public int insertApplyFormAttacheFile(HashMap<String, Object> params);
	
	/**
	 * 申请发票上传附件更新（只能更新remark），保存时候调用
	 * 
	 * @param params(formId, attcheFileId)
	 * @return
	 */
	public int updateApplyFormAttacheFile(HashMap<String, Object> params);

	/**
	 * 申请发票上传附件删除
	 * 
	 * @param params (formId, attcheFileId)
	 * @return
	 */
	public int deleteApplyFormAttacheFile(HashMap<String, Object> params);

	/**
	 * 发票取得
	 * @param params
	 * @return
	 */
	public ArrayList<HashMap<String,Object>> getApplyFormInvoiceList(HashMap<String, Object> params);
	
	/**
	 * 营业税发票取得
	 * @param params
	 * @return
	 */
	public ArrayList<HashMap<String,Object>> getApplyFormInvoiceTaxList(HashMap<String, Object> params);

	/**
	 * 发票一览删除
	 * @param params
	 * @return
	 */
	public int deleteApplyFormInvoiceList(HashMap<String,Object> params);
	
	/**
	 * 发票一览保存
	 * @param params
	 * @return
	 */
	public int insertApplyFormInvoiceList(HashMap<String,Object> params);

	/**
	 * 发票营业税一览删除
	 * @param params
	 * @return
	 */
	public int deleteApplyFormInvoiceTaxList(HashMap<String,Object> params);
	
	/**
	 * 发票营业税一览保存
	 * @param params
	 * @return
	 */
	public int insertApplyFormInvoiceTaxList(HashMap<String,Object> params);

	/**
	 * 发票表单保存
	 * @param params
	 * @return
	 */
	public int insertApplyForm(HashMap<String, Object> params);

	/**
	 * 发票表单更新
	 * @param params
	 * @return
	 */
	public int updateApplyForm(HashMap<String, Object> params);

	/**
	 * 发票表单撤回
	 * @param params
	 * @return
	 */
	public int rollBackApplyForm(HashMap<String, Object> params);

	
	/**
	 * 客户信息一览(联系方式)
	 * @param params
	 * @return
	 */
	public int getMdataCustomerListCount(HashMap<String,Object> params);

	/**
	 * 客户信息一览
	 * @param param
	 * @return
	 */
	public ArrayList<HashMap<String,Object>> getMdataCustomerList(HashMap<String,Object> params);

	/**
	 * 客户信息详细
	 * @param param
	 * @return
	 */
	public HashMap<String,Object> getMdataCustomerDetail(HashMap<String,Object> params);
	
	/**
	 * 收件人信息一览件数(联系方式)
	 * @param params
	 * @return
	 */
	public int getMdataCustomerAddrListCount(HashMap<String,Object> params);
	
	/**
	 * 收件人信息一览(联系方式)
	 * @param param
	 * @return
	 */
	public ArrayList<HashMap<String,Object>> getMdataCustomerAddrList(HashMap<String,Object> params);

	/**
	 * 收件人信息详细(联系方式)
	 * @param param
	 * @return
	 */
	public HashMap<String,Object> getMdataCustomerAddrDetail(HashMap<String,Object> params);

	/**
	 * 取得表单提交状态
	 * @param param
	 * @return
	 */
	public ArrayList<HashMap<String, Object>> getSubmitStatus(HashMap<String, Object> param);

	// 获取最大formno
	public String getMaxFormNo();

	public ArrayList<HashMap<String, Object>> getApplyFormColumns(
			HashMap<String, Object> params);

	// 获取表单提交状态
	public ArrayList<HashMap<String, Object>> getSubFlag(
			HashMap<String, Object> params);

	public ArrayList<HashMap<String, Object>> getFormListFormStatus(
			HashMap<String, Object> params);

	public ArrayList<HashMap<String, Object>> getFormListCustName(
			HashMap<String, Object> params);

	public ArrayList<HashMap<String, Object>> getFormListFormNo(
			HashMap<String, Object> params);
	
}
